package org.jshand.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerControlller {


    @Autowired
    RestTemplate restTemplate;


    /**
     * http://localhost:10081/echo/web
     * @param str
     * @return
     */
    @GetMapping(value = "/echo/{str}")
    public String echo(@PathVariable String str) {
        return restTemplate.getForObject("http://service-provider/echo/" + str, String.class);
    }

}